package com.cction.comm;

import android.content.Context;

import com.yanyusong.y_divideritemdecoration.Y_Divider;
import com.yanyusong.y_divideritemdecoration.Y_DividerBuilder;
import com.yanyusong.y_divideritemdecoration.Y_DividerItemDecoration;

public class LinDividerItemDecoration extends Y_DividerItemDecoration {

    private final int COLOR = 0xffEDEDED;
    private final int WIDTHDP = 1;
    private final int STARTPADDINGDP = 0;
    private final int ENDPADDINGDP = 0;

    public LinDividerItemDecoration(Context context) {
        super(context);
    }

    @Override
    public Y_Divider getDivider(int itemPosition) {
        Y_Divider divider = null;

        if (itemPosition == 0) {
            divider = new Y_DividerBuilder()
                    .setTopSideLine(true, COLOR, WIDTHDP, STARTPADDINGDP, ENDPADDINGDP)
                    .setBottomSideLine(true, COLOR, WIDTHDP, STARTPADDINGDP, ENDPADDINGDP)
                    .create();
        } else {
            divider = new Y_DividerBuilder()
                    .setBottomSideLine(true, COLOR, WIDTHDP, STARTPADDINGDP, ENDPADDINGDP)
                    .create();
        }
        return divider;
    }
}